package com.example.dao;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.Date;

@Repository("orderDao")
public interface OrderDao extends Serializable {
    @Update("update orders set state=-1 where order_time<#{endDate} and state=0")
    int updateByDate(Date endDate);

    @Select("select count(*) from orders where order_time<#{endDate} and state=0")
    long countByOrderTime(Date endDate);
}
